
# Built targets from RST files.
TARGETS=INSTALL.html adbsh.html pdish.html pdmail.html \
	pdmeasure.html pdmodem.html pdpowercycle.html pdreport.html \
	pdstoraged.html pdtestrun.html pdusb.html overview.html

# Native (x)html files.
DOCS=main.html software.html pdtools.html

DOCROOT=/var/www/powerdroid
RST2HTML=/usr/bin/rst2html.py

# The stylesheet link that will be placed within the built html docs.
STYLESHEET=/media/css/documents.css

all: $(TARGETS)

install: install-docs

install-docs: $(TARGETS) $(DOCS)
	@sudo mkdir -p $(DOCROOT)
	@sudo sh -c 'for F in $?; do cp $$F $(DOCROOT) ; done'

clean:
	@for F in $(TARGETS); do rm -f $$F ; done


%.html: %.txt
	$(RST2HTML) --strip-comments --initial-header-level=2 \
	--link-stylesheet --stylesheet=$(STYLESHEET) $*.txt $*.html

